//
//  XQBaseViewController.swift
//  XiaoQiQiaoSwift
//
//  Created by tech-lab on 2016/11/24.
//  Copyright © 2016年 校企桥. All rights reserved.
//

import UIKit

class XQBaseViewController: UIViewController {

    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        self.view.backgroundColor = UIColor.white
        self.edgesForExtendedLayout = UIRectEdge.init(rawValue: 0)
        self.navigationController?.navigationBar.isTranslucent = false
        
        setLeftBackBarButton()
        
        setRootView()
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    
    //自定义方法
    
    func setLeftBackBarButton() {
        let letBarItem = UIBarButtonItem.init(image: UIImage.init(named: "back"), style: .done, target: self, action:#selector(XQBaseViewController.backLeft))
        self.navigationItem.leftBarButtonItem = letBarItem
    }
    
    func setLeftBackBarButtonText(text:String) {
          let letBarItem = UIBarButtonItem.init(title: text, style: .done, target: self, action: #selector(XQBaseViewController.backLeft))
        self.navigationItem.leftBarButtonItem = letBarItem
        
    }
    
    func backLeft() {
        self.navigationController!.popViewController(animated: true)
        
    }
 
    func setRightBarButtonWithImage(normalImage:UIImage){
        let rightBaritem = UIBarButtonItem.init(image: UIImage.init(named: ""), style: .done, target: self, action:#selector(XQHomeViewController.doneRight))
        self.navigationItem.rightBarButtonItem = rightBaritem
    }
    
    func doneRight() {
        
    }
    
    public  func setRootView() {
        
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
